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 "chrome/browser/download/download_extension_api.h" | 5 #include "chrome/browser/download/download_extension_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cctype> | 8 #include <cctype> |
9 #include <iterator> | 9 #include <iterator> |
10 #include <set> | 10 #include <set> |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 EXTENSION_FUNCTION_VALIDATE(header->GetString( | 412 EXTENSION_FUNCTION_VALIDATE(header->GetString( |
413 kHeaderValueKey, &value)); | 413 kHeaderValueKey, &value)); |
414 if (!net::HttpUtil::IsSafeHeader(name)) { | 414 if (!net::HttpUtil::IsSafeHeader(name)) { |
415 error_ = download_extension_errors::kGenericError; | 415 error_ = download_extension_errors::kGenericError; |
416 return false; | 416 return false; |
417 } | 417 } |
418 } | 418 } |
419 } | 419 } |
420 iodata_->rdh = ResourceDispatcherHost::Get(); | 420 iodata_->rdh = ResourceDispatcherHost::Get(); |
421 iodata_->resource_context = profile()->GetResourceContext(); | 421 iodata_->resource_context = profile()->GetResourceContext(); |
422 iodata_->render_process_host_id = render_view_host()->process()->GetID(); | 422 iodata_->render_process_host_id = render_view_host()->GetProcess()->GetID(); |
423 iodata_->render_view_host_routing_id = render_view_host()->routing_id(); | 423 iodata_->render_view_host_routing_id = render_view_host()->GetRoutingID(); |
424 return true; | 424 return true; |
425 } | 425 } |
426 | 426 |
427 bool DownloadsDownloadFunction::RunInternal() { | 427 bool DownloadsDownloadFunction::RunInternal() { |
428 VLOG(1) << __FUNCTION__ << " " << iodata_->url.spec(); | 428 VLOG(1) << __FUNCTION__ << " " << iodata_->url.spec(); |
429 if (!BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( | 429 if (!BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( |
430 &DownloadsDownloadFunction::BeginDownloadOnIOThread, this))) { | 430 &DownloadsDownloadFunction::BeginDownloadOnIOThread, this))) { |
431 error_ = download_extension_errors::kGenericError; | 431 error_ = download_extension_errors::kGenericError; |
432 return false; | 432 return false; |
433 } | 433 } |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 ListValue args; | 1034 ListValue args; |
1035 args.Append(arg); | 1035 args.Append(arg); |
1036 std::string json_args; | 1036 std::string json_args; |
1037 base::JSONWriter::Write(&args, false, &json_args); | 1037 base::JSONWriter::Write(&args, false, &json_args); |
1038 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( | 1038 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( |
1039 event_name, | 1039 event_name, |
1040 json_args, | 1040 json_args, |
1041 profile_, | 1041 profile_, |
1042 GURL()); | 1042 GURL()); |
1043 } | 1043 } |
OLD | NEW |