| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer_host/database_dispatcher_host.h" | 5 #include "chrome/browser/renderer_host/database_dispatcher_host.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #include "base/file_descriptor_posix.h" | 8 #include "base/file_descriptor_posix.h" |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 382 } |
| 383 | 383 |
| 384 void DatabaseDispatcherHost::OnAllowDatabase(const std::string& origin_url, | 384 void DatabaseDispatcherHost::OnAllowDatabase(const std::string& origin_url, |
| 385 const string16& name, | 385 const string16& name, |
| 386 const string16& display_name, | 386 const string16& display_name, |
| 387 unsigned long estimated_size, | 387 unsigned long estimated_size, |
| 388 IPC::Message* reply_msg) { | 388 IPC::Message* reply_msg) { |
| 389 GURL url = GURL(origin_url); | 389 GURL url = GURL(origin_url); |
| 390 ContentSetting content_setting = | 390 ContentSetting content_setting = |
| 391 host_content_settings_map_->GetContentSetting( | 391 host_content_settings_map_->GetContentSetting( |
| 392 url, CONTENT_SETTINGS_TYPE_COOKIES); | 392 url, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
| 393 if (content_setting == CONTENT_SETTING_ASK) { | 393 if (content_setting == CONTENT_SETTING_ASK) { |
| 394 // Create a task for each possible outcome. | 394 // Create a task for each possible outcome. |
| 395 scoped_ptr<Task> on_allow(NewRunnableMethod( | 395 scoped_ptr<Task> on_allow(NewRunnableMethod( |
| 396 this, &DatabaseDispatcherHost::AllowDatabaseResponse, | 396 this, &DatabaseDispatcherHost::AllowDatabaseResponse, |
| 397 reply_msg, CONTENT_SETTING_ALLOW)); | 397 reply_msg, CONTENT_SETTING_ALLOW)); |
| 398 scoped_ptr<Task> on_block(NewRunnableMethod( | 398 scoped_ptr<Task> on_block(NewRunnableMethod( |
| 399 this, &DatabaseDispatcherHost::AllowDatabaseResponse, | 399 this, &DatabaseDispatcherHost::AllowDatabaseResponse, |
| 400 reply_msg, CONTENT_SETTING_BLOCK)); | 400 reply_msg, CONTENT_SETTING_BLOCK)); |
| 401 // And then let the permission request object do the rest. | 401 // And then let the permission request object do the rest. |
| 402 scoped_refptr<DatabasePermissionRequest> request( | 402 scoped_refptr<DatabasePermissionRequest> request( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 database_size, space_available)); | 447 database_size, space_available)); |
| 448 } | 448 } |
| 449 } | 449 } |
| 450 | 450 |
| 451 void DatabaseDispatcherHost::OnDatabaseScheduledForDeletion( | 451 void DatabaseDispatcherHost::OnDatabaseScheduledForDeletion( |
| 452 const string16& origin_identifier, | 452 const string16& origin_identifier, |
| 453 const string16& database_name) { | 453 const string16& database_name) { |
| 454 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); | 454 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); |
| 455 Send(new ViewMsg_DatabaseCloseImmediately(origin_identifier, database_name)); | 455 Send(new ViewMsg_DatabaseCloseImmediately(origin_identifier, database_name)); |
| 456 } | 456 } |
| OLD | NEW |