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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 int render_process_id = rfh->GetProcess()->GetID(); | 128 int render_process_id = rfh->GetProcess()->GetID(); |
129 int render_frame_id = rfh->GetRoutingID(); | 129 int render_frame_id = rfh->GetRoutingID(); |
130 AwResourceDispatcherHostDelegate::OnIoThreadClientReady( | 130 AwResourceDispatcherHostDelegate::OnIoThreadClientReady( |
131 render_process_id, render_frame_id); | 131 render_process_id, render_frame_id); |
132 } | 132 } |
133 | 133 |
134 } // namespace | 134 } // namespace |
135 | 135 |
136 // static | 136 // static |
137 AwContents* AwContents::FromWebContents(WebContents* web_contents) { | 137 AwContents* AwContents::FromWebContents(WebContents* web_contents) { |
| 138 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
138 return AwContentsUserData::GetContents(web_contents); | 139 return AwContentsUserData::GetContents(web_contents); |
139 } | 140 } |
140 | 141 |
141 // static | 142 // static |
142 AwContents* AwContents::FromID(int render_process_id, int render_view_id) { | 143 AwContents* AwContents::FromID(int render_process_id, int render_view_id) { |
143 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
144 const content::RenderViewHost* rvh = | 144 const content::RenderViewHost* rvh = |
145 content::RenderViewHost::FromID(render_process_id, render_view_id); | 145 content::RenderViewHost::FromID(render_process_id, render_view_id); |
146 if (!rvh) return NULL; | 146 if (!rvh) return NULL; |
147 content::WebContents* web_contents = | 147 content::WebContents* web_contents = |
148 content::WebContents::FromRenderViewHost(rvh); | 148 content::WebContents::FromRenderViewHost(rvh); |
149 if (!web_contents) return NULL; | 149 if (!web_contents) return NULL; |
150 return FromWebContents(web_contents); | 150 return FromWebContents(web_contents); |
151 } | 151 } |
152 | 152 |
153 AwContents::AwContents(scoped_ptr<WebContents> web_contents) | 153 AwContents::AwContents(scoped_ptr<WebContents> web_contents) |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 return; | 1097 return; |
1098 | 1098 |
1099 browser_view_renderer_.TrimMemory(level, visible); | 1099 browser_view_renderer_.TrimMemory(level, visible); |
1100 } | 1100 } |
1101 | 1101 |
1102 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1102 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1103 g_should_download_favicons = true; | 1103 g_should_download_favicons = true; |
1104 } | 1104 } |
1105 | 1105 |
1106 } // namespace android_webview | 1106 } // namespace android_webview |
OLD | NEW |