OLD | NEW |
---|---|
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/browser/renderer_host/pepper/pepper_file_system_browser_host.h " | 5 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h " |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "content/browser/renderer_host/pepper/pepper_file_io_host.h" | 9 #include "content/browser/renderer_host/pepper/pepper_file_io_host.h" |
10 #include "content/browser/renderer_host/pepper/quota_reservation.h" | 10 #include "content/browser/renderer_host/pepper/quota_reservation.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 browser_ppapi_host_(host), | 56 browser_ppapi_host_(host), |
57 type_(type), | 57 type_(type), |
58 called_open_(false), | 58 called_open_(false), |
59 opened_(false), | 59 opened_(false), |
60 file_system_context_(NULL), | 60 file_system_context_(NULL), |
61 reserved_quota_(0), | 61 reserved_quota_(0), |
62 reserving_quota_(false), | 62 reserving_quota_(false), |
63 weak_factory_(this) { | 63 weak_factory_(this) { |
64 } | 64 } |
65 | 65 |
66 PepperFileSystemBrowserHost::~PepperFileSystemBrowserHost() { | 66 PepperFileSystemBrowserHost::~PepperFileSystemBrowserHost() { |
bbudge
2014/01/07 14:48:18
We have a way to detect plugin crashes in the rend
tzik
2014/01/08 11:59:29
Done.
| |
67 if (!files_.empty()) { | |
68 file_system_context_->default_file_task_runner()->PostTask( | |
69 FROM_HERE, | |
70 base::Bind(&QuotaReservation::OnClientCrash, quota_reservation_)); | |
71 } | |
72 | |
67 // All FileRefs and FileIOs that reference us must have been destroyed. Cancel | 73 // All FileRefs and FileIOs that reference us must have been destroyed. Cancel |
68 // all pending file system operations. | 74 // all pending file system operations. |
69 if (file_system_operation_runner_) | 75 if (file_system_operation_runner_) |
70 file_system_operation_runner_->Shutdown(); | 76 file_system_operation_runner_->Shutdown(); |
71 } | 77 } |
72 | 78 |
73 void PepperFileSystemBrowserHost::OpenExisting(const GURL& root_url, | 79 void PepperFileSystemBrowserHost::OpenExisting(const GURL& root_url, |
74 const base::Closure& callback) { | 80 const base::Closure& callback) { |
75 root_url_ = root_url; | 81 root_url_ = root_url; |
76 int render_process_id = 0; | 82 int render_process_id = 0; |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 if (!IsAsciiAlpha(*it) && !IsAsciiDigit(*it) && | 497 if (!IsAsciiAlpha(*it) && !IsAsciiDigit(*it) && |
492 *it != '.' && *it != '_' && *it != '-') { | 498 *it != '.' && *it != '_' && *it != '-') { |
493 LOG(WARNING) << "Failed to generate a plugin id."; | 499 LOG(WARNING) << "Failed to generate a plugin id."; |
494 return std::string(); | 500 return std::string(); |
495 } | 501 } |
496 } | 502 } |
497 return output; | 503 return output; |
498 } | 504 } |
499 | 505 |
500 } // namespace content | 506 } // namespace content |
OLD | NEW |