有人可以一劳永逸地解释一下无法调用确定的Visibility()-从未见过该pid的连接 [英] Could someone once and for all please explain Cannot call determinedVisibility() - never saw a connection for the pid

查看:315
本文介绍了有人可以一劳永逸地解释一下无法调用确定的Visibility()-从未见过该pid的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在通过d3将数据绘制成Web视图.自然地,一旦我尝试重新加载图形并为其提供新数据,事情就会崩溃.这条可爱的线不断弹出:W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid.

I'm currently working on graphing data via d3 into a webview. Naturally, things are breaking as soon as I try to reload the graph and feed it new data. This lovely line keeps popping up: W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid.

我已经搜集了SO进行解释,但是似乎没有定论.人们只是建议在Webview设置中打开DOM存储(这显然不能解决问题).我怀疑在重新加载图形和为其提供新数据之间存在竞争状况.我已经在WebViewClient中重写onPageFinished()来调用侦听器以将数据加载到图表中,以为它可以解决竞争状况,但无济于事.

I've scoured SO for an explanation, but there doesn't seem to be anything conclusive. People are just suggesting to turn on DOM storage in webview settings (which obviously doesn't fix the issue). I'm suspecting there is a race condition between reloading the graph and feeding it new data. I've overridden onPageFinished() in my WebViewClient to call the listener to load the data into the chart, thinking it would resolve the race condition, but to no avail.

有人可以向我解释W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid是什么意思吗?我是否在评估中?我该如何调试?

Can someone please explain to me what W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid means? Am I off in my assessment? How can I debug it?

任何提示都值得赞赏.

我已经解决了原来的问题,但是我仍然很想学习该行的含义.赏金.

I've solved the original issue, but I would still love to learn what that line means. Bounty up.

推荐答案

loadUrl的连续调用会导致争用情况.问题是loadUrl("file://..")不会立即完成,因此,当您调用loadUrl("javascript:..")时,它有时会在页面加载之前执行.
这就是我设置webview:

Consecutive calls to loadUrl cause a race condition. The problem is that loadUrl("file://..") doesn't complete immediately, and so when you call loadUrl("javascript:..") it will sometimes execute before the page has loaded.
This is how I setup my webview:

wv = (CustomWebView) this.findViewById(R.id.webView1);

WebSettings wv_settings = wv.getSettings();

//this is where you fixed your code I guess
//And also by setting a WebClient to catch javascript's console messages :

wv.setWebChromeClient(new WebChromeClient() {
        public boolean onConsoleMessage(ConsoleMessage cm) {
            Log.d(TAG, cm.message() + " -- From line "
                    + cm.lineNumber() + " of "
                    + cm.sourceId() );
            return true;
        }
    });
wv_settings.setDomStorageEnabled(true);

wv.setWebViewClient(new WebViewClient() {
        @Override
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
            setTitle(view.getTitle());
            //do your stuff ...
            }
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if (url.startsWith("file")) 
        {
            // Keep local assets in this WebView.
             return false;
        }
      }
    });

//wv.setWebViewClient(new HelpClient(this));//
wv.clearCache(true);
wv.clearHistory();
wv_settings.setJavaScriptEnabled(true);//XSS vulnerable
wv_settings.setJavaScriptCanOpenWindowsAutomatically(true);
wv.loadUrl("file:///android_asset/connect.php.html");

注意此行wv.setWebChromeClient(new WebChromeClient());

在API级别19(Android 4.4 KitKat)中,浏览器引擎Android webkit切换为chromium webkit,几乎所有原始WebView API's都包装到了对应的副本chromium webkit.

In API level 19 (Android 4.4 KitKat), the browser engine switched from Android webkit to chromium webkit, with almost all the original WebView API's wrapped to the counterparts of chromium webkit.

是从铬源:

@Override
public void determinedVisibility(int pid) {
    ManagedConnection managedConnection;
    synchronized (mManagedConnections) {
        managedConnection = mManagedConnections.get(pid);
    }
    if (managedConnection == null) {
        Log.w(TAG, "Cannot call determinedVisibility() - never saw a connection for the pid: "
                + "%d", pid);
        return;
    }


这是来自内容的呈现警告.
您可以在github源代码中永远进行挖掘,可能很高兴看到从...(后缀"Impl")在哪里调用方法determinedVisibility(在BindingManagerImpl.java中). 希望对您有所帮助; O)


It's a rendering warning from content.
You can dig around forever in that github source code, might be nice to see where the method determinedVisibility (in BindingManagerImpl.java) is called from...(suffix "Impl" for Implementation). Hope this helps ;O)

这篇关于有人可以一劳永逸地解释一下无法调用确定的Visibility()-从未见过该pid的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆