Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1447563002: Implement frame attribution (FrameBlamer) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 11 matching lines...) Expand all
22 #include "base/memory/shared_memory.h" 22 #include "base/memory/shared_memory.h"
23 #include "base/memory/weak_ptr.h" 23 #include "base/memory/weak_ptr.h"
24 #include "base/metrics/field_trial.h" 24 #include "base/metrics/field_trial.h"
25 #include "base/metrics/histogram.h" 25 #include "base/metrics/histogram.h"
26 #include "base/process/process.h" 26 #include "base/process/process.h"
27 #include "base/stl_util.h" 27 #include "base/stl_util.h"
28 #include "base/strings/string16.h" 28 #include "base/strings/string16.h"
29 #include "base/strings/utf_string_conversions.h" 29 #include "base/strings/utf_string_conversions.h"
30 #include "base/thread_task_runner_handle.h" 30 #include "base/thread_task_runner_handle.h"
31 #include "base/time/time.h" 31 #include "base/time/time.h"
32 #include "base/trace_event/trace_event_argument.h"
32 #include "build/build_config.h" 33 #include "build/build_config.h"
33 #include "cc/base/switches.h" 34 #include "cc/base/switches.h"
34 #include "components/scheduler/renderer/renderer_scheduler.h" 35 #include "components/scheduler/renderer/renderer_scheduler.h"
35 #include "content/child/appcache/appcache_dispatcher.h" 36 #include "content/child/appcache/appcache_dispatcher.h"
36 #include "content/child/permissions/permission_dispatcher.h" 37 #include "content/child/permissions/permission_dispatcher.h"
37 #include "content/child/plugin_messages.h" 38 #include "content/child/plugin_messages.h"
38 #include "content/child/quota_dispatcher.h" 39 #include "content/child/quota_dispatcher.h"
39 #include "content/child/request_extra_data.h" 40 #include "content/child/request_extra_data.h"
40 #include "content/child/service_worker/service_worker_handle_reference.h" 41 #include "content/child/service_worker/service_worker_handle_reference.h"
41 #include "content/child/service_worker/service_worker_network_provider.h" 42 #include "content/child/service_worker/service_worker_network_provider.h"
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 CHECK(result.second) << "Inserting a duplicate item."; 1088 CHECK(result.second) << "Inserting a duplicate item.";
1088 1089
1089 frame_ = web_frame; 1090 frame_ = web_frame;
1090 } 1091 }
1091 1092
1092 void RenderFrameImpl::Initialize() { 1093 void RenderFrameImpl::Initialize() {
1093 is_main_frame_ = !frame_->parent(); 1094 is_main_frame_ = !frame_->parent();
1094 1095
1095 RenderFrameImpl* parent_frame = RenderFrameImpl::FromWebFrame( 1096 RenderFrameImpl* parent_frame = RenderFrameImpl::FromWebFrame(
1096 frame_->parent()); 1097 frame_->parent());
1097 if (parent_frame) 1098 if (parent_frame) {
1098 is_using_lofi_ = parent_frame->IsUsingLoFi(); 1099 is_using_lofi_ = parent_frame->IsUsingLoFi();
1100 blame_context_ = make_scoped_ptr(new RenderFrameBlameContext(
1101 routing_id_, *parent_frame->blame_context_));
1102 } else {
1103 blame_context_ = make_scoped_ptr(new RenderFrameBlameContext(
1104 routing_id_, *RenderThreadImpl::current()->blame_context()));
1105 }
1106 web_blame_context_ =
1107 make_scoped_ptr(new WebBlameContextImpl(blame_context_.get()));
1108 blame_context_->TakeSnapshot();
1099 1109
1100 bool is_tracing = false; 1110 bool is_tracing = false;
1101 TRACE_EVENT_CATEGORY_GROUP_ENABLED("navigation", &is_tracing); 1111 TRACE_EVENT_CATEGORY_GROUP_ENABLED("navigation", &is_tracing);
1102 if (is_tracing) { 1112 if (is_tracing) {
1103 int parent_id = GetRoutingIdForFrameOrProxy(frame_->parent()); 1113 int parent_id = GetRoutingIdForFrameOrProxy(frame_->parent());
1104 TRACE_EVENT2("navigation", "RenderFrameImpl::Initialize", 1114 TRACE_EVENT2("navigation", "RenderFrameImpl::Initialize",
1105 "id", routing_id_, 1115 "id", routing_id_,
1106 "parent", parent_id); 1116 "parent", parent_id);
1107 } 1117 }
1108 1118
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after
2579 return external_popup_menu_.get(); 2589 return external_popup_menu_.get();
2580 #else 2590 #else
2581 return NULL; 2591 return NULL;
2582 #endif 2592 #endif
2583 } 2593 }
2584 2594
2585 blink::WebCookieJar* RenderFrameImpl::cookieJar() { 2595 blink::WebCookieJar* RenderFrameImpl::cookieJar() {
2586 return &cookie_jar_; 2596 return &cookie_jar_;
2587 } 2597 }
2588 2598
2599 blink::WebBlameContext* RenderFrameImpl::frameBlameContext() {
2600 return web_blame_context_.get();
2601 }
2602
2589 blink::WebServiceWorkerProvider* 2603 blink::WebServiceWorkerProvider*
2590 RenderFrameImpl::createServiceWorkerProvider() { 2604 RenderFrameImpl::createServiceWorkerProvider() {
2591 // At this point we should have non-null data source. 2605 // At this point we should have non-null data source.
2592 DCHECK(frame_->dataSource()); 2606 DCHECK(frame_->dataSource());
2593 if (!ChildThreadImpl::current()) 2607 if (!ChildThreadImpl::current())
2594 return nullptr; // May be null in some tests. 2608 return nullptr; // May be null in some tests.
2595 ServiceWorkerNetworkProvider* provider = 2609 ServiceWorkerNetworkProvider* provider =
2596 ServiceWorkerNetworkProvider::FromDocumentState( 2610 ServiceWorkerNetworkProvider::FromDocumentState(
2597 DocumentState::FromDataSource(frame_->dataSource())); 2611 DocumentState::FromDataSource(frame_->dataSource()));
2598 DCHECK(provider); 2612 DCHECK(provider);
(...skipping 3503 matching lines...) Expand 10 before | Expand all | Expand 10 after
6102 int match_count, 6116 int match_count,
6103 int ordinal, 6117 int ordinal,
6104 const WebRect& selection_rect, 6118 const WebRect& selection_rect,
6105 bool final_status_update) { 6119 bool final_status_update) {
6106 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6120 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6107 selection_rect, ordinal, 6121 selection_rect, ordinal,
6108 final_status_update)); 6122 final_status_update));
6109 } 6123 }
6110 6124
6111 } // namespace content 6125 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698