Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / content / browser / frame_host / navigation_request.cc
blobfb46ae59b3d9c10ad87d021dd60dd5010efb342f
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/frame_host/navigation_request.h"
7 #include "base/logging.h"
8 #include "content/browser/loader/resource_dispatcher_host_impl.h"
9 #include "content/common/resource_request_body.h"
10 #include "content/public/browser/browser_thread.h"
12 namespace content {
14 namespace {
16 void OnBeginNavigation(const NavigationRequestInfo& info,
17 scoped_refptr<ResourceRequestBody> request_body,
18 int64 frame_node_id) {
19 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
20 ResourceDispatcherHostImpl::Get()->NavigationRequest(
21 info, request_body, frame_node_id);
24 } // namespace
26 NavigationRequest::NavigationRequest(const NavigationRequestInfo& info,
27 int64 frame_node_id)
28 : info_(info),
29 frame_node_id_(frame_node_id) {
32 NavigationRequest::~NavigationRequest() {
33 // TODO(clamy): Cancel the corresponding request in ResourceDispatcherHost if
34 // it has not commited yet.
37 void NavigationRequest::BeginNavigation(
38 scoped_refptr<ResourceRequestBody> request_body) {
39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
40 BrowserThread::PostTask(
41 BrowserThread::IO,
42 FROM_HERE,
43 base::Bind(&OnBeginNavigation, info_, request_body, frame_node_id_));
46 } // namespace content