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

Side by Side Diff: content/browser/service_worker/service_worker_client_utils.cc

Issue 2912593003: [ServiceWorker] Fix bugs of wpt tests for Client.navigate (Closed)
Patch Set: Catch navigation error Created 3 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/service_worker/service_worker_client_utils.h" 5 #include "content/browser/service_worker/service_worker_client_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <tuple> 8 #include <tuple>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 public: 52 public:
53 OpenURLObserver(WebContents* web_contents, 53 OpenURLObserver(WebContents* web_contents,
54 int frame_tree_node_id, 54 int frame_tree_node_id,
55 const OpenURLCallback& callback) 55 const OpenURLCallback& callback)
56 : WebContentsObserver(web_contents), 56 : WebContentsObserver(web_contents),
57 frame_tree_node_id_(frame_tree_node_id), 57 frame_tree_node_id_(frame_tree_node_id),
58 callback_(callback) {} 58 callback_(callback) {}
59 59
60 void DidFinishNavigation(NavigationHandle* navigation_handle) override { 60 void DidFinishNavigation(NavigationHandle* navigation_handle) override {
61 DCHECK(web_contents()); 61 DCHECK(web_contents());
62 if (!navigation_handle->HasCommitted()) 62 if (!navigation_handle->HasCommitted()) {
falken 2017/06/12 01:50:14 Add a comment like: // Return error.
leonhsl(Using Gerrit) 2017/06/12 07:18:13 Done.
63 RunCallback(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE);
leonhsl(Using Gerrit) 2017/06/10 02:57:44 DidFinishNavigation() should definitely fire the c
falken 2017/06/12 01:50:14 According to HasCommitted() documentation, this al
leonhsl(Using Gerrit) 2017/06/12 07:18:12 I checked through but did not find any wpt tests a
falken 2017/06/12 07:27:26 Not sure if error pages should be clients. But we
63 return; 64 return;
65 }
64 66
65 if (navigation_handle->GetFrameTreeNodeId() != frame_tree_node_id_) 67 if (navigation_handle->GetFrameTreeNodeId() != frame_tree_node_id_) {
falken 2017/06/12 01:50:14 // Return error.
leonhsl(Using Gerrit) 2017/06/12 07:18:12 Done.
68 RunCallback(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE);
66 return; 69 return;
70 }
67 71
68 RenderFrameHost* render_frame_host = 72 RenderFrameHost* render_frame_host =
69 navigation_handle->GetRenderFrameHost(); 73 navigation_handle->GetRenderFrameHost();
70 RunCallback(render_frame_host->GetProcess()->GetID(), 74 RunCallback(render_frame_host->GetProcess()->GetID(),
71 render_frame_host->GetRoutingID()); 75 render_frame_host->GetRoutingID());
72 } 76 }
73 77
74 void RenderProcessGone(base::TerminationStatus status) override { 78 void RenderProcessGone(base::TerminationStatus status) override {
75 RunCallback(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE); 79 RunCallback(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE);
76 } 80 }
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 options.client_type == blink::kWebServiceWorkerClientTypeAll) { 540 options.client_type == blink::kWebServiceWorkerClientTypeAll) {
537 GetWindowClients(controller, options, callback, std::move(clients)); 541 GetWindowClients(controller, options, callback, std::move(clients));
538 return; 542 return;
539 } 543 }
540 544
541 GetNonWindowClients(controller, options, callback, std::move(clients)); 545 GetNonWindowClients(controller, options, callback, std::move(clients));
542 } 546 }
543 547
544 } // namespace service_worker_client_utils 548 } // namespace service_worker_client_utils
545 } // namespace content 549 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698