OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 int render_process_id = rfh->GetProcess()->GetID(); | 126 int render_process_id = rfh->GetProcess()->GetID(); |
127 int render_frame_id = rfh->GetRoutingID(); | 127 int render_frame_id = rfh->GetRoutingID(); |
128 AwResourceDispatcherHostDelegate::OnIoThreadClientReady( | 128 AwResourceDispatcherHostDelegate::OnIoThreadClientReady( |
129 render_process_id, render_frame_id); | 129 render_process_id, render_frame_id); |
130 } | 130 } |
131 | 131 |
132 } // namespace | 132 } // namespace |
133 | 133 |
134 // static | 134 // static |
135 AwContents* AwContents::FromWebContents(WebContents* web_contents) { | 135 AwContents* AwContents::FromWebContents(WebContents* web_contents) { |
| 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
136 return AwContentsUserData::GetContents(web_contents); | 137 return AwContentsUserData::GetContents(web_contents); |
137 } | 138 } |
138 | 139 |
139 // static | 140 // static |
140 AwContents* AwContents::FromID(int render_process_id, int render_view_id) { | 141 AwContents* AwContents::FromID(int render_process_id, int render_view_id) { |
141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
142 const content::RenderViewHost* rvh = | 142 const content::RenderViewHost* rvh = |
143 content::RenderViewHost::FromID(render_process_id, render_view_id); | 143 content::RenderViewHost::FromID(render_process_id, render_view_id); |
144 if (!rvh) return NULL; | 144 if (!rvh) return NULL; |
145 content::WebContents* web_contents = | 145 content::WebContents* web_contents = |
146 content::WebContents::FromRenderViewHost(rvh); | 146 content::WebContents::FromRenderViewHost(rvh); |
147 if (!web_contents) return NULL; | 147 if (!web_contents) return NULL; |
148 return FromWebContents(web_contents); | 148 return FromWebContents(web_contents); |
149 } | 149 } |
150 | 150 |
151 AwContents::AwContents(scoped_ptr<WebContents> web_contents) | 151 AwContents::AwContents(scoped_ptr<WebContents> web_contents) |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 return; | 1062 return; |
1063 | 1063 |
1064 browser_view_renderer_.TrimMemory(level, visible); | 1064 browser_view_renderer_.TrimMemory(level, visible); |
1065 } | 1065 } |
1066 | 1066 |
1067 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1067 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1068 g_should_download_favicons = true; | 1068 g_should_download_favicons = true; |
1069 } | 1069 } |
1070 | 1070 |
1071 } // namespace android_webview | 1071 } // namespace android_webview |
OLD | NEW |