| OLD | NEW | 
|   1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |   1 // Copyright (c) 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 "content/renderer/renderer_webapplicationcachehost_impl.h" |   5 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 
|   6  |   6  | 
|   7 #include "content/common/view_messages.h" |   7 #include "content/common/view_messages.h" | 
|   8 #include "content/renderer/render_thread_impl.h" |   8 #include "content/renderer/render_thread_impl.h" | 
|   9 #include "content/renderer/render_view_impl.h" |   9 #include "content/renderer/render_view_impl.h" | 
|  10 #include "third_party/WebKit/public/web/WebFrame.h" |  10 #include "third_party/WebKit/public/web/WebFrame.h" | 
|  11 #include "third_party/WebKit/public/web/WebView.h" |  11 #include "third_party/WebKit/public/web/WebView.h" | 
|  12  |  12  | 
|  13 using blink::WebApplicationCacheHostClient; |  13 using blink::WebApplicationCacheHostClient; | 
|  14 using blink::WebConsoleMessage; |  14 using blink::WebConsoleMessage; | 
|  15  |  15  | 
|  16 namespace content { |  16 namespace content { | 
|  17  |  17  | 
|  18 RendererWebApplicationCacheHostImpl::RendererWebApplicationCacheHostImpl( |  18 RendererWebApplicationCacheHostImpl::RendererWebApplicationCacheHostImpl( | 
|  19     RenderViewImpl* render_view, |  19     RenderViewImpl* render_view, | 
|  20     WebApplicationCacheHostClient* client, |  20     WebApplicationCacheHostClient* client, | 
|  21     AppCacheBackend* backend) |  21     AppCacheBackend* backend, | 
|  22     : WebApplicationCacheHostImpl(client, backend), |  22     int appcache_host_id) | 
 |  23     : WebApplicationCacheHostImpl(client, backend, appcache_host_id), | 
|  23       routing_id_(render_view->GetRoutingID()) {} |  24       routing_id_(render_view->GetRoutingID()) {} | 
|  24  |  25  | 
|  25 void RendererWebApplicationCacheHostImpl::OnLogMessage( |  26 void RendererWebApplicationCacheHostImpl::OnLogMessage( | 
|  26     AppCacheLogLevel log_level, const std::string& message) { |  27     AppCacheLogLevel log_level, const std::string& message) { | 
|  27   if (RenderThreadImpl::current()->layout_test_mode()) |  28   if (RenderThreadImpl::current()->layout_test_mode()) | 
|  28     return; |  29     return; | 
|  29  |  30  | 
|  30   RenderViewImpl* render_view = GetRenderView(); |  31   RenderViewImpl* render_view = GetRenderView(); | 
|  31   if (!render_view || !render_view->webview() || |  32   if (!render_view || !render_view->webview() || | 
|  32       !render_view->webview()->mainFrame()) |  33       !render_view->webview()->mainFrame()) | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
|  51         routing_id_, info.manifest_url, false)); |  52         routing_id_, info.manifest_url, false)); | 
|  52   } |  53   } | 
|  53   WebApplicationCacheHostImpl::OnCacheSelected(info); |  54   WebApplicationCacheHostImpl::OnCacheSelected(info); | 
|  54 } |  55 } | 
|  55  |  56  | 
|  56 RenderViewImpl* RendererWebApplicationCacheHostImpl::GetRenderView() { |  57 RenderViewImpl* RendererWebApplicationCacheHostImpl::GetRenderView() { | 
|  57   return RenderViewImpl::FromRoutingID(routing_id_); |  58   return RenderViewImpl::FromRoutingID(routing_id_); | 
|  58 } |  59 } | 
|  59  |  60  | 
|  60 }  // namespace content |  61 }  // namespace content | 
| OLD | NEW |